import axios from 'axios'

const request = axios.create({
  baseURL:'http://localhost:3000',
  timeout:6000,
  headers:{
    'Content-Type':'application/json'
  }
})

request.interceptors.request.use((config)=>{
  console.log(config)
  return config
  },(error)=>{
  return Promise.reject(error)
})

request.interceptors.response.use(response=>{
  return response.data
},err=>{
  return Promise.reject(err)
})

export default request